
{volist name="$addonFieldExtList" id="vo"}
    {if !isset($vo.ifeditable) || $vo.ifeditable}
        {switch name="vo.dtype"}
            {case value="hidden"}
                <!-- 隐藏域 start -->
                <div class="layui-form-item none">
                    <label class="layui-form-label">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<b>*</b>{/if}{$vo.title|default=''}</label>
                    <div class="layui-input-inline">
                        <input type="hidden" class="layui-input" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}">
                    </div>
                    <div class="layui-input-inline layui-btn-container " style="width: auto;">
                        <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                        <div class="layui-form-inline2 ey_helptips_txt">{$vo.remark|default=''}</div>
                    </div>
                </div>
                <!-- 隐藏域 start -->
            {/case}

            {case value="text"}
                <!-- 单行文本框 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<b>*</b>{/if}{$vo.title|default=''}</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default=''}">
                    </div>
                    <div class="layui-input-inline layui-input-company" style="line-height:38px;">
                        {$vo.dfvalue_unit|default=''}
                    </div>
                    <div class="layui-input-inline layui-btn-container " style="width: auto;">
                        <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                        <div class="layui-form-inline2 ey_helptips_txt">{$vo.remark|default=''}</div>
                    </div>
                </div>
                <!-- 单行文本框 end -->
            {/case}

            {case value="multitext"}
                <!-- 多行文本框 start -->
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<b>*</b>{/if}{$vo.title|default=''}</label>
                    <div class="layui-input-inline">
                        <textarea id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" class="layui-textarea">{$vo.dfvalue|default=''}</textarea>
                    </div>
                    <div class="layui-input-inline layui-btn-container " style="width: auto;">
                        <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                        <div class="layui-form-inline2 ey_helptips_txt">{$vo.remark|default=''}</div>
                    </div>
                </div>
                <!-- 多行文本框 end -->
            {/case}

            {case value="checkbox"}
                <!-- 复选框 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<b>*</b>{/if}{$vo.title|default=''}</label>
                    <div class="layui-input-inline w500">
                        {volist name="$vo.dfvalue" id="v2"}
                        <input type="checkbox" lay-skin="primary" lay-filter="addonFieldExt" name="{$vo.fieldArr}[{$vo.name|default=''}][]" data-callback="func_{$vo.name}_eyempty" value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}checked="checked"{/if} title="{$v2}">
                        {/volist}
                        <input type="hidden" name="{$vo.fieldArr}[{$vo.name}_eyempty]" value="{if condition="!empty($vo['trueValue'])"}1{else /}0{/if}">
                    </div>
                    <div class="layui-input-inline layui-btn-container " style="width:auto;">
                        <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                        <div class="layui-form-inline2 ey_helptips_txt">{$vo.remark|default=''}</div>
                    </div>
                </div>
                <script type="text/javascript">
                    function func_{$vo.name}_eyempty()
                    {
                        var len = $("input[name='{$vo.fieldArr}[{$vo.name}][]']:checked").length;
                        $("input[name='{$vo.fieldArr}[{$vo.name}_eyempty]']").val(len);
                    }
                </script>
                <!-- 复选框 end -->
            {/case}

            {case value="radio"}
                <!-- 单选项 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<b>*</b>{/if}{$vo.title|default=''}</label>
                    <div class="layui-input-inline">
                        {volist name="$vo.dfvalue" id="v2"}
                        <input type="radio" id="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}checked="checked"{/if} title="{$v2}">
                        {/volist}
                    </div>
                    <div class="layui-input-inline layui-btn-container " style="width: auto;">
                        <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                        <div class="layui-form-inline2 ey_helptips_txt">{$vo.remark|default=''}</div>
                    </div>
                </div>
                <!-- 单选项 end -->
            {/case}

            {case value="switch"}
                <!-- 开关 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<b>*</b>{/if}{$vo.title|default=''}</label>
                    <div class="layui-input-block">
                        <input type="checkbox" id="{$vo.fieldArr}[{$vo.name|default=''}]" lay-filter="{$vo.fieldArr}[{$vo.name|default=''}]" lay-skin="switch" lay-text="是|否" {if condition="0 != $vo['dfvalue']"} checked {/if}>
                        <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}]" value="{$vo.dfvalue|default='0'}" />
                    </div>
                    <div class="layui-input-inline layui-btn-container " style="width: auto;">
                        <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                        <div class="layui-form-inline2 ey_helptips_txt">{$vo.remark|default=''}</div>
                    </div>
                </div>
                <!-- 开关 end -->
            {/case}

            {case value="select"}
                <!-- 下拉框 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<b>*</b>{/if}{$vo.title|default=''}</label>
                    <div class="layui-input-inline">
                        <select name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}">
                            {volist name="$vo.dfvalue" id="v2"}
                            <option value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}selected{/if}>{$v2}</option>
                            {/volist}
                        </select>
                    </div>
                    <div class="layui-input-inline layui-btn-container " style="width: auto;">
                        <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                        <div class="layui-form-inline2 ey_helptips_txt">{$vo.remark|default=''}</div>
                    </div>
                </div>
                <!-- 下拉框 end -->
            {/case}

            {case value="img"}
                <!-- 单张图 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<b>*</b>{/if}{$vo.title|default=''}</label>
                    <div class="layui-input-inline">
                        <div class="upload-box">
                          <div class="upload-img fl">
                            <div class="icaction none">
                              <span class="load_images">
                                 <a href="javascript:void(0);" onclick="BigImages($('#img_{$vo.fieldArr}_{$vo.name|default=''}_gzpcf_local').attr('src'));">
                                 <i class="layui-icon layui-icon-search mr5"></i>查看
                                 </a>
                              </span>
                              <span class="load_images">
                                <a href="javascript:void(0);" data-inputid="{$vo.fieldArr}_{$vo.name|default=''}_gzpcf_local" onclick="DelImages(this);">
                                <i class="layui-icon layui-icon-delete mr5"></i>删除
                                </a>
                              </span>
                            </div>
                            <div class="cover-bg none"></div>
                            <img id="img_{$vo.fieldArr}_{$vo.name|default=''}_gzpcf_local" src="{$vo[$vo['name'].'_gzpcf_local']|get_default_pic=###}">
                          </div>
                          <div class="upload-right fl">
                            <button class="layui-btn test-upload-demoMore layui-btn-primary layui-btn-sm fl mb10 mr5" lay-data="{number:1,ey_inputId:'{$vo.fieldArr}_{$vo.name|default=''}_gzpcf_local',ey_savepath:'allimg'}"><i class="layui-icon">&#xe67c;</i>上传图片</button>
                            <button class="layui-btn layui-btn-sm layui-btn-primary layui-btn-sm fl mb10" onClick="GetPictureFolder(1,'{$vo.fieldArr}_{$vo.name|default=''}_gzpcf_local');"><i class="layui-icon">&#xe64a;</i>图库</button>
                            <input name="{$vo.fieldArr}[{$vo.name|default=''}_gzpcf_local]" id="{$vo.fieldArr}_{$vo.name|default=''}_gzpcf_local" placeholder="图片地址" value="{$vo[$vo['name'].'_gzpcf_local']|default=''}" class="layui-input">
                          </div>
                        </div>
                    </div>
                    <div class="layui-input-inline layui-btn-container" style="width: auto;">
                        <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                        <div class="ey_helptips_txt">{$vo.remark|default=''}</div>
                    </div>
                </div>
                <!-- 单张图 end -->
            {/case}

            {case value="imgs"}
                <!-- 多张图 start -->
                <div class="layui-form-item ">
                    <label class="layui-form-label">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<b>*</b>{/if}{$vo.title|default=''}</label>
                    <div class="layui-input-inline layadmin-layer-demo">
                        <button class="layui-btn multi-upload-demoMore layui-btn-sm fl" lay-data="{number:100,ey_savepath:'allimg',ey_callback:'{$vo.fieldArr}_{$vo.name|default=''}_call_back'}"><i class="layui-icon">&#xe67c;</i>上传图片</button>
                        <button class="layui-btn layui-btn-sm fl" onClick="GetPictureFolder(100,'{$vo.fieldArr}_{$vo.name|default=''}','{$vo.fieldArr}_{$vo.name|default=''}_call_back');"><i class="layui-icon">&#xe64a;</i>图库</button>
                    </div>
                </div>
                <div class="layui-form-item {if empty($vo[$vo['name'].'_gzpcf_imgupload_list'])}none{/if}" id="dl_{$vo.fieldArr}_{$vo.name|default=''}">
                    <label class="layui-form-label"></label>
                    <div class="edit-box-con2 fl sort-list-{$vo.fieldArr}_{$vo.name|default=''}" id="{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl">
                        {volist name="$vo[$vo['name'].'_gzpcf_imgupload_list']" id="v2" key="k2"}
                        <div class="images-upload" style="margin-top:0px;margin-bottom:10px" id="tpcf_{$k2}">
                            <div class="upimg">
                                <input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="{$v2}">
                                <a class="del-bt" href="javascript:void(0);" style="color:white;" onclick="{$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr22(this);" data-src="{$v2}" data-ppd="pcf_{$k2}">删除</a>
                                <div class="cover-bg2" style="display:block"></div>              
                                <img src="{$v2}">   
                            </div>
                        </div>
                        {/volist}
                    </div>
                </div>
                <script type="text/javascript">
                    // 上传多图回调函数
                    function {$vo.fieldArr}_{$vo.name|default=''}_call_back(pathObj){
                        if (Array.isArray(pathObj)){
                            var paths = pathObj;
                        }else{
                            var paths = [pathObj.url];
                        }
                        $("#dl_{$vo.fieldArr}_{$vo.name|default=''}").show();
                        for (var i=0;i<paths.length ;i++ )
                        {
                            var html = '<div class="images-upload" style="margin-top:0px;margin-bottom:10px" id="tpcf_'+i+'">';
                            html+='<div class="upimg">';
                            html+='<input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="'+paths[i]+'">';
                            html+='<a class="del-bt" href="javascript:void(0);" style="color:white;" onclick="{$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr22(this);" data-src="'+paths[i]+'" data-ppd="pcf_'+i+'">删除</a>';
                            html+='<div class="cover-bg2" style="display:block"></div>';
                            html+='<img src="'+paths[i]+'"> ';
                            html+='</div>';
                            html+='</div>';
                            $(html).appendTo($("#{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl"));
                        }            
                    }
                    /*
                     * 上传之后删除组图input     
                     * @access   public
                     * @val      string  删除的图片input
                     */
                    function {$vo.fieldArr}_{$vo.name|default=''}_ClearPicArr22(obj)
                    {
                        var path = $(obj).attr('data-ppd');
                        $("#t"+path).remove();
                        var pcf = document.getElementById("{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl").innerText;
                        if(!pcf){
                            var html = '<input type="hidden" name="{$vo.fieldArr}[{$vo.name|default=''}][]" value="">';
                            $(html).appendTo($("#{$vo.fieldArr}_{$vo.name|default=''}_upload_tpl"));
                        }
                    }
                    /** 以下 产品相册的拖动排序相关 js*/
                    $( ".sort-list-{$vo.fieldArr}_{$vo.name|default=''}" ).sortable({
                        start: function( event, ui) {
                        },stop: function( event, ui ) {
                        }
                    });
                    $( ".sort-list-{$vo.fieldArr}_{$vo.name|default=''}" ).disableSelection();
                </script>
                <!-- 多张图 end -->
            {/case}

            {case value="int"}
                <!-- 整数类型 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<b>*</b>{/if}{$vo.title|default=''}</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$vo.dfvalue|default='0'}" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}" placeholder="只允许纯数字" class="layui-input" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^0-9]/g,''));">
                    </div>
                    <div class="layui-input-inline layui-input-company"  style="line-height:38px;">
                        {$vo.dfvalue_unit|default=''}
                    </div>
                    <div class="layui-input-inline layui-btn-container " style="width: auto;">
                        <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                        <div class="layui-form-inline2 ey_helptips_txt">{$vo.remark|default=''}</div>
                    </div>
                </div>
                <!-- 整数类型 end -->
            {/case}

            {case value="float"}
                <!-- 小数类型 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<b>*</b>{/if}{$vo.title|default=''}</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$vo.dfvalue|default='0'}" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}" placeholder="允许带有小数点的数值" class="layui-input" onkeyup="this.value=this.value.replace(/[^0-9\.]/g,'');" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^0-9\.]/g,''));">
                    </div>
                    <div class="layui-input-inline layui-input-company" style="line-height:38px;">
                        {$vo.dfvalue_unit|default=''}
                    </div>
                    <div class="layui-input-inline layui-btn-container " style="width: auto;">
                        <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                        <div class="layui-form-inline2 ey_helptips_txt">{$vo.remark|default=''}</div>
                    </div>
                </div>
                <!-- 小数类型 end -->
            {/case}

            {case value="decimal"}
                <!-- 金额类型 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<b>*</b>{/if}{$vo.title|default=''}</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$vo.dfvalue|default='0.00'}" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}" placeholder="允许带有小数点的数值" class="layui-input" onkeyup="this.value=this.value.replace(/[^0-9\.]/g,'');" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^0-9\.]/g,''));">
                    </div>
                    <div class="layui-input-inline layui-input-company"  style="line-height:38px;">
                        {$vo.dfvalue_unit|default=''}
                    </div>
                    <div class="layui-input-inline layui-btn-container " style="width: auto;">
                        <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                        <div class="layui-form-inline2 ey_helptips_txt">{$vo.remark|default=''}</div>
                    </div>
                </div>
                <!-- 金额类型 end -->
            {/case}

            {case value="datetime"}
                <!-- 日期和时间 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<b>*</b>{/if}{$vo.title|default=''}</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" name="{$vo.fieldArr}[{$vo.name|default=''}]" id="{$vo.fieldArr}_{$vo.name|default=''}" value="{$vo['dfvalue']}">
                    </div>
                    <div class="layui-input-inline layui-btn-container " style="width: auto;">
                        <div class="layui-form-mid layui-word-aux ey_helptips"></div>
                        <div class="layui-form-inline2 ey_helptips_txt">{$vo.remark|default=''}</div>
                    </div>
                </div>
                <script type="text/javascript">
                    $(function () {
                        laydate.render({
                          elem: '#{$vo.fieldArr}_{$vo.name|default=''}',type: 'datetime'
                        });  
                    });
                </script>
                <!-- 日期和时间 end -->
            {/case}

            {case value="htmltext"}
                <!-- HTML文本 start -->
                <div class="layui-inline layui-col-md12"  style="margin-bottom:15px;">
                    <label class="layui-form-label">{if condition="isset($vo['ifrequire']) AND !empty($vo['ifrequire'])"}<b style="color:red;">*</b>{/if}{$vo.title|default=''}</label>
                    <div class="layui-input-block">
                        <textarea  class="ckeditor" id="{$vo.fieldArr}_{$vo.name|default=''}" data-func="{$vo.fieldArr}_{$vo.name|default=''}" name="{$vo.fieldArr}[{$vo.name|default=''}]">{$vo.dfvalue|raw}</textarea>
                        <p style="margin-top:10px;">
                            <a href="javascript:void(0);" onclick="remote_to_local_{$vo.fieldArr}_{$vo.name|default=''}();" class="layui-btn layui-btn-danger layui-btn-xs">远程图片本地化</a>
                            &nbsp;
                            <a href="javascript:void(0);" onclick="replace_links_{$vo.fieldArr}_{$vo.name|default=''}();" class="layui-btn layui-btn-normal layui-btn-xs">清除非本站链接</a>
                        </p>
                    </div>
                </div>
                <script type="text/javascript">
                    UE.getEditor('{$vo.fieldArr}_{$vo.name|default=''}',{
                        serverUrl :"{:url('/system.ueditor/index',array('savepath'=>'ueditor'))}",
                        zIndex: 999,
                        initialFrameWidth: "100%", //初化宽度
                        initialFrameHeight: 450, //初化高度            
                        focus: false, //初始化时，是否让编辑器获得焦点true或false
                        maximumWords: 99999,
                        removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign',//允许的最大字符数 'fullscreen',
                        pasteplain:false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴，true为使用纯文本粘贴
                        autoHeightEnabled: false,
                        toolbars: ueditor_toolbars
                    });
                    //必须在提交前渲染编辑器；
                    function {$vo.fieldArr}_{$vo.name|default=''}() {
                        //判断编辑模式状态:0表示【源代码】HTML视图；1是【设计】视图,即可见即所得；-1表示不可用
                        if(UE.getEditor("{$vo.fieldArr}_{$vo.name|default=''}").queryCommandState('source') != 0) {
                            UE.getEditor("{$vo.fieldArr}_{$vo.name|default=''}").execCommand('source'); //切换到【设计】视图
                        }
                    }
                    // 远程图片本地化
                    function remote_to_local_{$vo.fieldArr}_{$vo.name|default=''}() {
                        var body = UE.getEditor("{$vo.fieldArr}_{$vo.name|default=''}").getContent();
                        layer.msg('下载中请勿刷新页面', {icon: 16,shade: 0.01});
                        $.ajax({
                            type: 'POST',
                            url: "{:url('/system.Ueditor/ajax_remote_to_local')}",
                            data: {body:body},
                            dataType: "JSON",
                            success: function(res){
                                layer.closeAll();
                                if (res.status) {
                                    UE.getEditor("{$vo.fieldArr}_{$vo.name|default=''}").setContent(res.body);
                                    layer.msg(res.msg, {icon: 1, time:1000});
                                } else {
                                    layer.msg(res.msg, {icon: 2, time:1000});
                                }
                            },
                            error: function(e){
                                layer.closeAll();
                                layer.msg("未知错误，请求中断！", {icon: 2, time:1000});
                            }
                        });
                    }
                    // 清除非本站链接
                    function replace_links_{$vo.fieldArr}_{$vo.name|default=''}() {
                        var body = UE.getEditor("{$vo.fieldArr}_{$vo.name|default=''}").getContent();
                        layer.msg('正在处理请勿刷新页面', {icon: 16,shade: 0.01});
                        $.ajax({
                            type: 'POST',
                            url: "{:url('/system.Ueditor/ajax_replace_links')}",
                            data: {body:body},
                            dataType: "JSON",
                            success: function(res){
                                layer.closeAll();
                                if (res.status) {
                                    UE.getEditor("{$vo.fieldArr}_{$vo.name|default=''}").setContent(res.body);
                                    layer.msg(res.msg, {icon: 1, time:1000});
                                } else {
                                    layer.msg(res.msg, {icon: 2, time:1000});
                                }
                            },
                            error: function(e){
                                layer.closeAll();
                                layer.msg("未知错误，请求中断！", {icon: 2, time:1000});
                            }
                        });
                    }
                </script>
                <!-- HTML文本 end -->
            {/case}

        {/switch}
    {/if}
{/volist}